const fs = require("fs");
const zlib = require('zlib');

module.exports = function (file, callback) { //压缩文件
    fs.createReadStream(file)
        .pipe(zlib.createGzip())
        .pipe(fs.createWriteStream(file + '.gz'));
    callback && callback()
}